package com.test.context;

import com.test.resource.FileSystemResource;
import com.test.resource.Resource;

public class FileSystemXmlApplicationContext extends AbstractXmlApplicationContext{

    private String[] configLocations;

    public FileSystemXmlApplicationContext(String configLocations) {
        this.configLocations = new String[]{configLocations};
    }

    public FileSystemXmlApplicationContext(String[] configLocations) throws Exception {
        this.configLocations = configLocations;
        refresh();
    }


    @Override
    protected String[] getConfigLocations() {
        return this.configLocations;
    }

    @Override
    public Resource getResource(String location) {
        return new FileSystemResource(location);
    }

    @Override
    public boolean containsBeanDefinition(String beanName) {
        return getBeanFactory().containsBeanDefinition(beanName);
    }
}
